﻿using System;
using ParserGenerator.SyntacticAnalysis;

namespace ParserGenerator.ScannerConstruction
{
    [Serializable]
    public sealed class ScannerAutomatonReduction : ScannerAutomatonItem
    {
        public LexicalRuleDeclarator Rule { get; }

        internal ScannerAutomatonReduction(int number, LexicalRuleDeclarator rule)
            : base(number)
        {
            if (rule == null)
                throw new ArgumentNullException(nameof(rule));
            Rule = rule;
        }

        public sealed override string ToString()
        {
            return base.ToString() + " # " + Rule;
        }
    }
}
